<%@page import="com.situ.web.entity.Banji"%>
<%@page import="java.util.ArrayList"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" type="text/css"
	href="lib/bootstrap-3.3.7-dist/css/bootstrap.css" />
</head>
<body>
</head>
<body>
	<a href="/JavaWeb1907/banji_insert.jsp" class="btn btn-info">添加</a>
	<form action="<%=request.getContextPath() %>/banji?method=search" method="post">
		<input type="text" name="searchName" /> 
		<input type="submit" value="搜索" />
	</form>
	<%-- 	${list} --%>
	<table
		class="table  table-striped table-bordered table-hover table-condensed">
		<tr>
			<td>ID</td>
			<td>名字</td>
			<td>删除</td>
			<td>修改</td>
		</tr>
		<c:forEach items="${list}" var="banji">
			<tr>
				<td>${banji.id}</td>
				<td>${banji.name}</td>
				<td><a href="javascript:void(0)" onclick="deleteById(${banji.id})">删除</a></td>
				<td><a href="/JavaWeb1907/banji?method=toUpdate&id=${banji.id}">修改</a></td>
			</tr>
		</c:forEach>
	</table>
	<script type="text/javascript">
		function deleteById(id){
			var isDel = confirm("您确定要删除么");
			if(isDel){
				location.href = "/JavaWeb1907/banji?method=deleteById&id=" + id;
		}
	}
	</script>
</html>